<html
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">

    <ui:composition template="layout.xhtml">

        <ui:define name="title">
            Saída
        </ui:define>
        <ui:define name="content">
            <h:form id="saidaForm">

                <div class="actions">

                    <div id="buttons">

                        <p:button value="Editar" outcome="criarSaida.xhtml"
                                  icon="ui-icon-pencil"
                                  styleClass="ui-priority-primary">
                            <f:param value="#{ managerPesquisarSaida.saidaVisualizar.id }" name="saidaId"/>
                        </p:button>

                        <p:button value="Pesquisar" outcome="pesquisarSaida.xhtml" icon="ui-icon-search"
                                  styleClass="ui-priority-primary botao_pesquisar" />

                        <p:commandButton value="Excluir" styleClass="botao_excluir" oncomplete="deletarSaidaDialog.show()" icon="ui-icon-trash">
                            <f:setPropertyActionListener target="#{ managerPesquisarSaida.saidaDeletar }" value="#{ managerPesquisarSaida.saidaVisualizar }" />
                        </p:commandButton>
                    </div>

                </div>  

                <p:fieldset legend="Dados" id="saidaPanel" >

                    <div class="row">
                        <div class="column2 bold">
                            <p:outputLabel value="Tipo da Saída:"/>
                        </div>
                        <div class="column3 text">
                            <p:outputLabel value="#{ managerPesquisarSaida.saidaVisualizar.tipoSaida.descricao }"/>
                        </div>

                        <div class="column3 bold">
                            <p:outputLabel value="Data da Saída:"/>
                        </div>
                        <div class="column3 text">
                            <p:outputLabel value="#{ managerPesquisarSaida.saidaVisualizar.dataSaida }">
                                <f:convertDateTime pattern="dd/MM/yyyy" />
                            </p:outputLabel>
                        </div>
                    </div>

                    <div class="row">
                        <div class="column2 bold">
                            <p:outputLabel value="Valor:"/>
                        </div>
                        <div class="column3 text">
                            <p:outputLabel value="#{ managerPesquisarSaida.saidaVisualizar.valor }">
                                <f:convertNumber type="currency" locale="pt-br" />
                            </p:outputLabel>
                        </div>
                    </div>                    
                    
                    <div class="row">
                        <div class="column2 bold">
                            <p:outputLabel value="Descrição:"/>
                        </div>
                        <div class="column9 text">
                            <p:outputLabel value="#{ managerPesquisarSaida.saidaVisualizar.descricao }"/>
                        </div>
                    </div>

                </p:fieldset>

                <p:dialog header="Deseja realmente excluir?" widgetVar="deletarSaidaDialog" modal="true"
                          closable="false" resizable="false" draggable="false" >
                    <div class="commandDialog">
                        <p:commandButton value="Sim"
                                         icon="ui-icon-check" actionListener="#{ managerPesquisarSaida.deletar() }" />
                        <p:commandButton value="Não" icon="ui-icon-close" oncomplete="deletarSaidaDialog.hide()" />
                    </div>
                </p:dialog>

            </h:form>

        </ui:define>
    </ui:composition>

</html>